<?php

require_once(sfConfig::get('sf_lib_dir').'/filter/base/BaseFormFilterPropel.class.php');

/**
 * DetallePedidos filter form base class.
 *
 * @package    tercermilenio
 * @subpackage filter
 * @author     Your name here
 */
class BaseDetallePedidosFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'det_ped_talle'       => new sfWidgetFormFilterInput(),
      'det_ped_cantidad'    => new sfWidgetFormFilterInput(),
      'det_ped_descripcion' => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'det_ped_talle'       => new sfValidatorPass(array('required' => false)),
      'det_ped_cantidad'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'det_ped_descripcion' => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('detalle_pedidos_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'DetallePedidos';
  }

  public function getFields()
  {
    return array(
      'det_ped_pedido'      => 'ForeignKey',
      'det_ped_item'        => 'Number',
      'det_ped_talle'       => 'Text',
      'det_ped_cantidad'    => 'Number',
      'det_ped_descripcion' => 'Text',
    );
  }
}
